package com.microservices.auth.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * Entity基类
 *
 * @author daiqiaohong
 * @since 2025/1/10
 */
@Getter
@Setter
public class BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    @TableLogic
    @TableField("is_deleted")
    @Schema(description = "是否删除 0：未删除；1：已删除")
    private Integer isDeleted;

    @TableField("create_by")
    @Schema(description = "创建人")
    private String createBy;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private Date createTime;

    @TableField("update_by")
    @Schema(description = "更新人")
    private String updateBy;

    @TableField("update_time")
    @Schema(description = "更新时间")
    private Date updateTime;

}